package DP.composite;

import java.util.ArrayList;

/**
 * @author msi
 * 树枝节点
 */
public class Composite extends Component{

    private ArrayList<Component> compositeArrayList=new ArrayList<>();

    public void add(Component component){
        compositeArrayList.add(component);
    }

    public void remove(Component component){
        compositeArrayList.remove(component);
    }

    public ArrayList<Component> getChildren(){
        return compositeArrayList;
    }

}
